<?php
namespace Admin\Frontend\Controllers;

use Helpers\Tool;
use Helpers\Main;
use Helpers\UserPower;
use Helpers\Template;
use Helpers\Assets;
class Ca102001Controller extends ControllerBase
{

    public function courseManageListAction()
    {
        $this->view->pick('ca102001/courseManageList');
        Main::showNavPosition();
        Assets::easyUI('js/ca102001/courseManageList.js');
//        $this->assets->addJs('');
        UserPower::checkUserPower('CA102001_Datum') or die(Main::showMessageModal('对不起，您没有查看此页面的权限！'));
        Template::exists('CA102001_Course', 'list') or die(Main::showMessageModal('相关配置文件不存在，请先创建！'));
        $listButtonArr = $formButtonArr = array();
        if(UserPower::checkUserPower('CA102001_Datum_Add')){
            $listButtonArr[] = array('plain'=>'true', 'id'=>'bt_list_add', 'text'=>'增加', 'icon'=>'fa-plus');
        }
        if(UserPower::checkUserPower('CA102001_Datum_Edit')){
            $listButtonArr[] = array('id'=>'bt_list_enable', 'text'=>'启用', 'plain'=>'true', 'icon'=>'fa-chain');
        }
        if(UserPower::checkUserPower('CA102001_Datum_Del')){
            $listButtonArr[] = array('plain'=>'true', 'id'=>'bt_list_del', 'text'=>'删除', 'icon'=>'fa-trash');
        }
        $this->view->setVars(array(
            'List' => Template::createList('List', 'CA102001_Course', array(
                'buttonToolbar' => Template::createButtonToolBar($listButtonArr)
            )),
        ));
    }

}

